package ltd.zouzheng.myutils.sftp;

/**
 * sftp文件传输工具

 * @author zouzheng
 * @date 2021/4/9
 */
public class SFTPUtil {

    public static void action(SftpSetting setting, ActionFunc<SFTPClient.Channel> func) {
        try (SFTPClient.Channel connect = SFTPClient.connect(setting.getHost(), setting.getPort(), setting.getUsername(), setting.getPassword())) {
            func.call(connect);
        }
    }

}
